--- title: "10、星际探险" created: 2025-11-28 tags: - 算法 --- # 10、星际探险 ## 题目 [星际探险](https://www.lanqiao.cn/problems/3228/learning/) ![[image-300603fb.png]] ## 思路分析 以为是贪心 就胡乱写了一通 结果没分 但是无伤大雅 贪心模拟并不难 25分的最后一题万一就蒙对了呢 是吧 ```cpp //贪心 每次大的回去 #include using namespace std; #define endl '\n' typedef long long LL; const LL mod=1e9+7; priority_queue q; int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n;cin>>n; for(int i=0;i>x; q.push(x); } LL sum=0; while(q.size()>1){ int First=q.top(); q.pop(); int Second=q.top(); q.pop(); sum=(sum+max(LL(pow(First,Second)),LL(pow(Second,First))))%mod; q.push(First); } cout<